package gov.ccswj.modules.bdbusiness.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import gov.ccswj.modules.bdbusiness.dao.ACcdataDao;
import gov.ccswj.modules.bdbusiness.dao.AIndustyGasDao;
import gov.ccswj.modules.bdbusiness.entity.ACcdataEntity;
import gov.ccswj.modules.bdbusiness.entity.AIndustyGasEntity;
import gov.ccswj.modules.bdbusiness.service.AIndustyGasService;



@Service("aIndustyGasService")
public class AIndustyGasServiceImpl implements AIndustyGasService {
	@Autowired
	private AIndustyGasDao aIndustyGasDao;
	@Autowired
	private ACcdataDao aCcdataDao;
	
	@Override
	public AIndustyGasEntity queryObject(Integer id){
		return aIndustyGasDao.queryObject(id);
	}
	
	@Override
	public List<AIndustyGasEntity> queryList(Map<String, Object> map){
		return aIndustyGasDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return aIndustyGasDao.queryTotal(map);
	}
	
	@Override
	public void save(AIndustyGasEntity aIndustyGas){
		aIndustyGasDao.save(aIndustyGas);
	}
	
	@Override
	public void update(AIndustyGasEntity aIndustyGas){
		aIndustyGasDao.update(aIndustyGas);
	}
	
	@Override
	public void delete(Integer id){
		aIndustyGasDao.delete(id);
	}
	
	@Override
	public void deleteBatch(Integer[] ids){
		aIndustyGasDao.deleteBatch(ids);
	}

	@Override
	public List<AIndustyGasEntity> getGasNum(Double ns, Double we,Double param) {
		Double x_n = ns + param;
		Double x_s = ns - param;
		Double x_w = we + param;
		Double x_e = we - param;
		
		return aIndustyGasDao.getGasRound(x_n,x_s,x_w,x_e);
	}

	@Override
	public List<ACcdataEntity> getData(Double ns, Double we, Double param) {
		Double x_n = ns + param;
		Double x_s = ns - param;
		Double x_w = we + param;
		Double x_e = we - param;
		
		return aCcdataDao.getData(x_n,x_s,x_w,x_e);
	}
	
}
